home *** CD-ROM | disk | FTP | other *** search
- /*================================================================================
- testReportError.c
-
- A simple test of the 'ReportError' package
- ================================================================================*/
- #include "reportError.h"
-
- /*
- // Macintosh includes
- */
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- /*
- //#ifndef __SYSEQU__
- // #include <SysEqu.h>
- //#endif
- */
- #ifndef __ERRORS__
- #include <Errors.h>
- #endif
- #ifndef __MEMORY__
- #include <Memory.h>
- #endif
- #ifndef __MENUS__
- #include <Menus.h>
- #endif
- #ifndef __FONTS__
- #include <Fonts.h>
- #endif
- #ifndef __EVENTS__
- #include <Events.h>
- #endif
- #ifndef __OSEVENTS__
- #include <OSEvents.h>
- #endif
-
- /*
- // The following includes are needed by MPW, but not Think C
- // (they don't hurt, though)
- */
- #ifndef __DIALOGS__
- #include <Dialogs.h>
- #endif
- #ifndef __TEXTEDIT__
- #include <TextEdit.h>
- #endif
- #ifndef __WINDOWS__
- #include <Windows.h>
- #endif
-
- void InitAll( void );
-
- /*--------------------------------------------------------------------------------
- Initialize all of the relivant Macintosh managers
- --------------------------------------------------------------------------------*/
- void InitAll()
- {
- MaxApplZone();
-
- InitGraf( &(qd.thePort) );
- InitFonts();
- FlushEvents(everyEvent, 0);
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs(0L);
-
- InitCursor();
- }
-
-
- /*--------------------------------------------------------------------------------
- A short test of 'ReportError'
- --------------------------------------------------------------------------------*/
- main()
- {
- Handle testHandle;
-
-
- InitAll();
-
- testHandle = NewHandle( 0x7FFFFFFF );
- ReportError( (unsigned char*)"\pThe memory block could not be allocated", MemError() );
- }
-